package com.ruoyi.carShop.service.impl;

import com.ruoyi.carShop.mapper.ShopZiliaoMapper;
import com.ruoyi.carShop.service.IShopZiliaoService;
import com.ruoyi.system.api.domain.Merchant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ShopZiliaoImpl implements IShopZiliaoService {

    @Autowired
    private ShopZiliaoMapper shopZiliaoMapper;

    @Override
    public List<Merchant> selectMerchantList(Long merchantId) {
        return shopZiliaoMapper.selectMerchantList(merchantId);
    }

    @Override
//    @Transactional
    public Integer updateShopZiliao(Merchant merchant) {
        System.out.println("Updating merchant: " + merchant);
        shopZiliaoMapper.updateMerchant(merchant);
        shopZiliaoMapper.updateMerchantImgs(merchant);
        shopZiliaoMapper.updateMerchantVerification(merchant);
        return 1;
    }
}
